package com.chushouya.manager.dto.admin.article;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.general.framework.core.lang.Dates;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@ApiModel("添加文章")
public class ArticleSaveDTO {

    /**
     * 分类id
     */
    @ApiModelProperty(value = "分类id", required = true)
    protected Long categoryId;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题", required = true)
    @NotBlank(message = "标题不能为空")
    protected String title;

    /**
     * 是否显示
     */
    @ApiModelProperty(value = "状态", required = true)
    protected Integer status;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序", required = false)
    protected Integer sort;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "2022-01-01 12:00:00")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    protected Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", example = "2022-01-01 12:00:00")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    protected Date updateTime;

    /**
     * 缩略图
     */
    @ApiModelProperty("缩略图")
    protected String image;


    /**
     * 描述
     */
    @ApiModelProperty("描述")
    protected String summary;

    /**
     * 文章内容
     */
    @ApiModelProperty("文章内容, 外链可不填")
    protected String content;

    /**
     * 外链
     */
    @ApiModelProperty("外链")
    protected String target;

    /**
     * 跳转类型
     */
    @ApiModelProperty("跳转类型")
    protected Integer routeType;

}
